<?php
namespace app\model;
use think\Model;

class Packages extends Model{

    protected $resultSetType = 'packages';


	public static function insertPackagesData($data) {
		$result=self::insertGetId($data);
		return $result;
	}

	public static function updatePackagesData($userId,$packageName,$data) {
		$result=self::where('user_id',$userId)->where('name',$packageName)->update($data);
		return $result;
	}

	public static function getUsersPackagesInfo($userId,$packageName) {
		$result=self::where('user_id',$userId)->where('name',$packageName)->find();
		return $result;
	}
	public static function getPackagesInfo($packageName) {
		$result=self::where('name',$packageName)->find();
		return $result;
	}






}